Skip to content

Conversation

pj-r
Copy link

@pj-r pj-r commented Jun 23, 2020

I had a case where I merged multiple pdf files to one and added multilevel bookmarking at the same time. For some unknown(for me) reason with multilevel bookmarks there is sometimes PdfInteger instead of PdfReference and its causing:
System.InvalidCastException: 'Unable to cast object of type 'PdfSharp.Pdf.PdfInteger' to type 'PdfSharp.Pdf.Advanced.PdfReference'.' At PdfOutline.SplitDestinationPage

I figured out the integer at least in my case was the actual page index so I added handling for that. In my case it did fix the problem.

image

…ger instead of PdfReference. Added handling for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant